<template>
	<!-- 备注 弹窗 -->
	<view class="item-info" :class="openShow === 0 ? 'none' : openShow === 1 ? 'show' : ''">
		<view class="cate-content">
			<view class="item-fixed-top">
				<view class="title">{{title}}</view>
				<view class="close" @click="close">
					<image src="../../static/images/close.png" mode="scaleToFill"></image>
				</view>
			</view>
			<view class="cate-list comm-list">
				<view class="note-box">
					<view class="note-item" v-for="(item,index) in newNoteArr" :key="index" >
						<view >
							<view class="n-i-a">
								<view>{{item.uname == "客户" ? "我" : "商家"}}</view>
								<view class="n-i-a-r" >{{item.atime_txt}}</view>
							</view>
							<view class="n-i-b">
								<view class="n-i-b-a" v-if="item.txt">{{item.txt}}</view>
								<view class="n-i-b-img" v-if="item.imgs && item.imgs.length > 0">
									<view class="item-img" v-for="(items,indexs) in item.imgs" :key="indexs">
										<image  :src="items.img_s" mode="widthFix" ></image>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:['newNoteArr'],
		data() {
			return {
				title : "备注详情",
				openShow : 0,
			};
		},
		methods: {
			/**显示分类面板 type:0付款记录，1：操作记录**/
			toggleBillsStateMask(type,data) 
			{
				let timer = type === 'show' ? 10 : 200;
				let state = type === 'show' ? 1 : 0;
				this.openShow = 2;
				setTimeout(() => {
					this.openShow = state;
				}, timer);
			},
			
			close()
			{
				this.toggleBillsStateMask();
			},
		},
	}
</script>
<style lang="scss">
	.item-info {
		position: fixed;
		z-index: 999;
		left: 0;
		top: 0;
		bottom: 0;
		width: 100%;
		background: #FFF;
		transition: 0.3s;
		overflow-y: hidden;
		display: flex;
		align-items: center;
		justify-content: center;
		.cate-content {
			border-radius: 6px;
			overflow: hidden;
			width: 500px;
			background: #F8F8F8;
			float: right;
			transform: translateY(-100%);
			transition: 0.3s;
			position: relative;
			.item-fixed-top
			{
				height: 50px;
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 14px;
				border-bottom: 1px solid #ECECEC;
				.title
				{
					font-size: 16px;
				}
				.close
				{
					position: absolute;
					right: 5px;
					top: 12px;
					width: 32px;
					height: 32px;
					text-align: center;
					cursor: pointer;
					image
					{
						width: 14px;
						height: 14px;
					}
				}
			}
		}
	
		&.none {
			display: none;
		}
		&.show {
			background: rgba(0, 0, 0, 0.3);
			.cate-content {
				transform: translateY(0);
			}
		}
	}
	.bg-color
	{
		background: #E6E6E6;
		padding: 10px;
	}
	.cate-list
	{
		height: 500px;
		
	}
	.note-box
	{
		margin-bottom: 20upx;
		.note-title
		{
			padding: 20upx 30upx;
			background: #FFF;
			font-size: 30upx;
			.imi-icon
			{
				position: absolute;
				right: 20upx;
				color: #999;
			}
			.icon-xia
			{
				transform:rotate(-90deg);
			}
			.icon-shang
			{
				transform:rotate(90deg);
			}
		}
		.note-item
		{
			padding: 0upx 30upx;
			background: #FEFEFE;
			border-top: 2upx solid #ECECEC;
			.n-i-a
			{
				padding-top: 20upx;
				display: flex;
				align-items: flex-end;
				justify-content: space-between;
				font-size: 30upx;
				.n-i-a-r
				{
					color: #999;
				}
			}
			.n-i-b
			{
				.n-i-b-a
				{
					padding: 10upx 0;
				}
				.n-i-b-img
				{
					display: flex;
					flex-wrap: wrap;
					.item-img
					{
						width: 32%;
						height: 200upx;
						margin-right: 2%;
						margin-bottom: 20upx;
						overflow: hidden;
						image{
							width: 100%;
							height: 100%;
						}
					}
					.item-img:nth-child(3n+3)
					{
						margin-right: 0%;
					}
				}
			}
		}
	}
</style>